<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/v2/console/common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String contextPath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta content="width=device-width, minimum-scale=1,initial-scale=1, maximum-scale=1, user-scalable=1" id="viewport" name="viewport" />
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />
		<meta content="telephone=no" name="format-detection" />
		<script src="${path}/v2/console/js/jquery-1.9.1.min.js"></script>
		<title>load方法的测试</title>
	</head>
	<body >
		<button id="ajax">AJAX REQUEST</button>
		<div id="content"></div>
		<a href="https://www.baidu.com/">href baidu</a>
		<button id="toPay">TO PAY</button>
	</body>
	
	<script type="text/javascript">
	
	try{
		window.addEventListener('DOMContentLoaded', domLoaded, false);
	}
	catch(e){
		alert('您的浏览器不支持');	
	}
	
	
	var path = "${path}";
	$("#ajax").click(function(){
		$.ajax({
		    url:path+'/demo/aboutAjaxRedis.html',
		    type:'POST', //GET
		    async:true,    //或false,是否异步
		    data:{},
		    timeout:5000,    //超时时间
		    dataType:'text',    //返回的数据格式：json/xml/html/script/jsonp/text
		    success:function(data,textStatus,jqXHR){
		    	//success load the page to store the ajax content
		    	$("#content").append("<b>"+data+"</b>");
		    	var substance = {sub:"<b>"+data+"</b>"};
		    	history.replaceState(substance, document.title, window.location.href);
		    },
		    error:function(xhr,textStatus){
		    }
		})
	});
		
 	/* var popstate = function(){
		$("#content").append(history.state.sub);
	}; */
	//window.addEventListener('popstate', popstate, false); 
	window.onload=function(){
		
		window.addEventListener("popstate", function() {
	    	alert("ＥｖｅｎｔＬｉｓｔｅｎｅｒ");                         
	    });
	}
	    
	    
		

	
	
	
	/* window.onpopstate = function() {
		$("#content").append(history.state.sub);
    }; */
	</script>
</html>
